import React from 'react'
import './examlistitem.less'
import EventNoteIcon from '@material-ui/icons/EventNote';
import { Button } from '@material-ui/core';
import LinearProgress from '@material-ui/core/LinearProgress';
import { useHistory } from 'react-router-dom'
export default function ExamListItem(props) {
    const history = useHistory()
    const gotoPractice=(actionCode)=>{
        history.push(`/selectQuestion/${actionCode}`)
    }
    return (
        <div className="exam-list-item">
            <EventNoteIcon />
            <div className="info">
                <h4>{props.data.info}</h4>
                <p>{props.data.itemCount} / {props.data.itemCount}</p>
                <LinearProgress variant='determinate' value={(props.data.itemCount / props.data.itemCount) * 100}></LinearProgress>
            </div>
            <Button variant="contained" color="primary" onClick={()=>gotoPractice(props.data.actionCode)}>练习</Button>
            
        </div>
    )
}
